<?php
/**
 * Smile_Recipe1
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0), a
 * copy of which is available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 *
 * @category   Smile
 * @package    Smile_Recipe1
 * @author     Smile <www.smile.fr>
 * @copyright  Copyright (c) 2011 Smile
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */

/**
 * Just a simple index controller
 *
 */
class Smile_Recipe1_IndexController extends Mage_Core_Controller_Front_Action {

	/**
	 * First subtask, plain old greeting.
	 * 
	 * Pay attention that "index" is default value.
	 * So it is callable by:
	 * 
	 * /recipe1/
	 * /recipe1/index/
	 * /recipe1/index/index/
	 * 
	 */
	public function indexAction() {
		echo "Hello, world!";
	}
	
	/**
	 * Second subtask, new action.
	 */
	public function goAction() {
		
		/*
		 * Attention! Just using echo is not enough for caching response with FullPageCache
		 */
	    $this->getResponse()->setBody("Show must go on");
	}
	
	public function wrongWayAction() {
		echo "It is wrong way to do it!";
		
		/**
		 * This is an evil, as connection is left opened for sometime and apache process doesn't accept new connections.
		 * 
		 * The most correct way is shown in goAction()
		 */
		die;
	}
	
	
	//TODO: _forward
	//TODO: redirect;
	//TODO: redirectReferer
}

?>
